<%--
  Created by IntelliJ IDEA.
  User: 86917
  Date: 2020/10/29
  Time: 15:27
  To change this template use File | Settings | File Templates.
--%><%--

    竣工档案

--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<%@include file="../layout/header.jsp" %>
<%@include file="../layout/script.jsp" %>
<head>
    <title>Title</title>
    <style>
        .table tbody tr.active {
            background: skyblue;
        }
        #syy.disabled,
        #xyy.disabled {
            color: #ccc;
            pointer-events: none;
        }
    </style>
</head>
<script type="text/javascript">
    $(document).ready(function(){
        //点击链接的时候调用
        $("#chaxun").click(function(){

            //得到input的值
            var arcNumsel = $("#arcNumsel").val();
            var prjName = $("#prjName").val();
            var prjAddr = $("#prjAddr").val();
            //设置linkToCart的href的值
            $("#chaxun").attr("href","${pageContext.request.contextPath}/arc_main/list?featureType=${mapData.get("featureType")}"+
            "&arcNumsel="+arcNumsel+"&prjName="+prjName+"&prjAddr="+prjAddr);
        });
        $("#syy").click(function(){
            //得到input的值
            var arcNumsel = $("#arcNumsel").val();
            var prjName = $("#prjName").val();
            var prjAddr = $("#prjAddr").val();
            var pageNo=${pageInfo.pageNum}-1;
            if(pageNo<1){
                pageNo=1;
            }
            //设置linkToCart的href的值
            var rul="${pageContext.request.contextPath}/arc_main/list?pageNo="+pageNo+"&featureType=${mapData.get("featureType")}"+
                "&arcNumsel="+arcNumsel+"&prjName="+prjName+"&prjAddr="+prjAddr;
            $("#syy").attr("href",rul);
            judgePageBtnState(pageNo)
        });

        $("#xyy").click(function(){
            //得到input的值
            var arcNumsel = $("#arcNumsel").val();
            var prjName = $("#prjName").val();
            var prjAddr = $("#prjAddr").val();
            var pageNo=${pageInfo.pageNum}+1;
            if(pageNo>${pageInfo.pages}){
                pageNo=${pageInfo.pages};
            }
            var rul="${pageContext.request.contextPath}/arc_main/list?pageNo="+pageNo+"&featureType=${mapData.get("featureType")}"+
                "&arcNumsel="+arcNumsel+"&prjName="+prjName+"&prjAddr="+prjAddr;
            //设置linkToCart的href的值
            $("#xyy").attr("href",rul);
            judgePageBtnState(pageNo)
        });
        function judgePageBtnState(curPage) {
            var totalPages = ${pageInfo.pages}
            if (curPage == 1) {
                $('#syy').addClass('disabled').attr('disabled', true)
            } else {
                $('#syy').removeClass('disabled').attr('disabled', false)
            }
            if (curPage == totalPages) {
                $('#xyy').addClass('disabled').attr('disabled', true)
            } else {
                $('#xyy').removeClass('disabled').attr('disabled', false)
            }
        }
        $('.detail').on('click', function() {
            $(this).parents('tr').addClass('active').siblings().removeClass('active')
        })
        judgePageBtnState(${pageInfo.pageNum} || 1)
    });
</script>
<body id="arcbody">
<div id="arcfilediv"  style="width: 100%;height: 100%;overflow: auto;padding:0 10px">
    <div>
        <table style="width: 100%;height: 100px">
            <!-- <tr style="height: 20px"></tr> -->
            <tr>
                <td style="width: 140px;" align="right">档案号:&nbsp;&nbsp;</td>
                <td style="width: 270px;"><input type="text" class="form-control input-sm" name="arcNumsel" id="arcNumsel" value="${mapData.get("arcNumsel")}"></td>
                <td style="width: 140px;" align="right">项目名称:&nbsp;&nbsp;</td>
                <td style="width: 270px;"><input type="text" class="form-control input-sm" name="prjName" id="prjName" value="${mapData.get("prjName")}"></td>
                <td style="width: 140px;" align="right">项目地址:&nbsp;&nbsp;</td>
                <td style="width: 270px;"><input type="text" class="form-control input-sm" name="bfName" id="bfName" value="${mapData.get("bfName")}"></td>
                <td style="width: 180px;" align="center"><a href="" id="chaxun"><input class="btn btn-info" type="button"  value="查询"></a></td>
                <td></td>
            </tr>
            <!-- <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td align="center"><a href="" id="chaxun"><input type="button"  value="查询"></a></td>
            </tr> -->
        </table>
    </div>
    <table class="table table-bordered">
        <thead>
        <tr>
            <td align="center" hidden="hidden">id</td>
            <td align="center">档号</td>
            <td align="center">许可证号</td>
            <td align="center">项目名称</td>
            <td align="center">建设单位</td>
            <td align="center">建设地址</td>
            <td align="center">总卷数</td>
            <td align="center">文件张数</td>
            <td align="center">图纸张数</td>
            <td align="center">照片张数</td>
            <td align="center">操作</td>
        </tr>
        </thead>
        <tbody>
            <c:forEach items="${pageInfo.list}" var="record">
                <tr>
                    <td align="center" hidden="hidden">${record.id}</td>
                    <td align="center">${record.arcNum}</td>
                    <td align="center">${record.acpNum}</td>
                    <td align="center">${record.prjName}</td>
                    <td align="center">${record.bfName}</td>
                    <td align="center">${record.prjAdr}</td>
                    <td align="center">${record.files}</td>
                    <td align="center">${record.papers}</td>
                    <td align="center">${record.graphs}</td>
                    <td align="center">${record.photos}</td>
                    <td align="center"><a class="detail" href="${pageContext.request.contextPath}/arc_file/fileIndex?arcNum=${record.arcNum}">详情</a></td>
                </tr>
            </c:forEach>
            <tr>
                <td colspan="28" style="text-align: right">
                    共${pageInfo.pages}页,当前页${pageInfo.pageNum},
                    <a id="syy" href="">上一页</a>,
                    <a id="xyy" href="">下一页</a>
                </td>
            </tr>

        </tbody>
    </table>
</div>
</body>
</html>
